package main

import (
	"log"
	"net/http"
	"sync"
)

var wg sync.WaitGroup

var urls = []string{
	"https://www.tnblog.net/",
	"https://www.tnblog.net/",
	"https://www.tnblog.net/",
}

func main() {
	for _, v := range urls {
		wg.Add(1)
		go func(url string) {
			defer wg.Done()

			resp, err := http.Get(url)
			if err == nil {
				log.Println(url, resp.Status)
			}
		}(v)
	}

	wg.Wait()
	log.Println("结束")
}
